package com.wyy.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;
/*分类*/
@Data
public class Category {
    @NotNull(groups = {Update.class,Delete.class})
    private Integer id;//主键ID
    @NotEmpty/*(groups = {Update.class,Add.class})*/
    @Pattern(regexp = "^\\S{1,10}",groups = {Update.class,Add.class})
    private String categoryName;//分类名称
    @NotEmpty/*(groups = {Update.class,Add.class})*/
    @Pattern(regexp = "^\\S{1,10}",groups = {Update.class,Add.class})
    private String categoryAlias;//分类别名
    private Integer createUser;//创建人ID
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;//创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;//更新时间

    public interface Delete{

    }

    public interface Add extends Builder.Default {

    }
    public interface Update extends Builder.Default {

    }
}
